package annotation;

import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

public class GenericTest {
    public static void main(String[] args) throws NoSuchMethodException {
        Class<GenericTest> genericTestClass = GenericTest.class;
        Method s = genericTestClass.getDeclaredMethod("s", List.class, Map.class);
        Type[] genericParameterTypes = s.getGenericParameterTypes();
        for (Type genericParameterType : genericParameterTypes) {
            System.out.println(genericParameterType.getTypeName());
        }
        Type[] genericExceptionTypes = s.getGenericExceptionTypes();
        for (Type genericExceptionType : genericExceptionTypes) {
            System.out.println(genericExceptionType.getTypeName());
        }
    }
    public void s(List<String> list,Map<String,Object> map){
        System.out.println("泛型反射测试");
    }
}
